Skip to main content

All Questions

2votes
2answers
448views

How should I implement data access with jpa to meet Clean Architecture/DDD

For the last few days I'm searching any information about compatibility of JPA and Clean Architecture/DDD. I found next ideas for decoupling application from hibernate. Do not use @ManyToMany or @...
AndyFlight's user avatar
1vote
0answers
66views

Best practice: slightly different logic on multi mapping endpoint

Suppose I've got a spring controller as follows: ⋮ @RestController public class MyController { ⋮ @PostMapping(value = { "publicAPI/addItem", "internalAPI/addItem" }) ...
zZz's user avatar
  • 11
6votes
3answers
653views

Hexagonal Architecture + Domain Driven Design. How to perform a correct implementation?

Currently, I am trying to implement these two architectures together with Java and Spring (although technology shouldn't matter I think). But I'm encountering problems getting them to work together. I ...
RuDaHee's user avatar
0votes
2answers
221views

Where perform mapping in strict Domain-Driven Design?

I want to create an example application where we use a strict domain-driven design and layering (controller, service, repository). Most notably, we have a clear distinction between the domain and the ...
Gman's user avatar
0votes
1answer
126views

Where to put getOrSave responsibility?

I have many repeated parts of service logic which just fetches object if it exists or returns a newly saved one. I want to move it from service because it just clutters up the logic. But I do not ...
DimitrijeCiric's user avatar
2votes
3answers
917views

How can I avoid duplicate annotations when validating both Entity and DTOs?

I am using the Spring Boot framework to create a RESTFUL API and I need a way to avoid the duplication of validation rules when using multiple DTOs as request/response objects for my endpoints. Using ...
Marco Pierre White's user avatar
1vote
2answers
846views

Confusion about layered architecture

Given a layered architecture consisting of presentation layer business logic layer data (access) layer and a SPA web application communicating through REST endpoints with the backend (eg Angular and ...
keezar's user avatar
9votes
1answer
2kviews

How to achieve both: clean (hexagonal) architecture with JPA goodies?

How do I achieve two things at the same time writing Java Spring Application: Clean Architecture JPA goodies (@Transactional, Optimistic Locking, dirty checking, etc.) I like the idea of database/...
Dariusz Mydlarz's user avatar
0votes
5answers
2kviews

performance suggestions on Aggregate root containing thousands of child entities

I understand that DDD is a design concept and implementation through ORMs are tricky but help me understand how would you solve this problem? So here is my confusion on changing on aggregates only ...
Dexters's user avatar
3votes
2answers
5kviews

How do entities, DTO, DOA work together and what’s their role within a system?

Most of my work is written in Java using Spring Boot. In a recent project my entities contained no business logic, Spring Data was used to handle repositories and I have service classes that ...
SheppardDigital's user avatar
5votes
3answers
3kviews

Handling domain errors in the API

I'm working on building an API interface on-top of a domain-driven architecture. The domain layer has a bunch of specific exception classes (i.e. NameIsRequiredException, CannotPublishDraftException, ...
NRaf's user avatar
  • 311
3votes
1answer
21kviews

Project Structure of Domain Driven Design in maven Java Spring-Boot [closed]

My team is in dilemma, we have an existing maven spring-boot Java8 project with following onion architechture. controller --> service --> dao --> jpa repositories ...
Dave Ranjan's user avatar
0votes
1answer
769views

In implementing layered API architecture with Spring MVC Boot, how to connect to various endpoints

If you want to implement a layered API design for example, you may have one API layer that represents the application layer. And I assume that the application layer is represented by an endpoint and ...
berlinbrown2's user avatar
19votes
3answers
8kviews

DDD - Is anemic domain model an antipattern? Shoud we be using rich domain models? [closed]

Anemic domain model was criticized a long time ago by Evans and Fowler, since apparently it goes against object oriented principles, etc. The DDD community is clearly aligned with this statements. ...
codependent's user avatar
4votes
1answer
1kviews

Does the Spring Data Repository implementation violate the principle of loose coupling?

So, at the moment I find myself building my c#/.net (web) application ( or folder/project/package-...) structure often like this, thinking about it in a "somewhat onion-architectural way": myApp -...
Dominik's user avatar

close